package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    int queryForCount(EmployeeQueryObject qo);

    List<Employee> queryForList(EmployeeQueryObject qo);

    void changeState(Long id);

    Employee checkName(String username);

    void deleteRelation(Long id);

    void insertRelation(@Param("empId") Long empId,@Param("roleId") Long roleId);


    //根据用户名查询是否有对应的信息
    Employee getByUsername(String name);
    //使用用户id查询角色编号
    Set<String> getRoleByEmpId(Long id);
    //根据用户id查询权限表达式,使用  set集合去重
    Set<String> getPermissionByEmpId(Long id);


}